package com.dubbo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dubbo.entity.User;
import com.dubbo.service.IUserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by wangdongdong on 2018/7/30 17:15.
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Reference(version = "1.0.0")
    private IUserService userService;

    @RequestMapping("/register")
    private String register() {
        User user = new User();
        user.setUsername("wdd");
        user.setPassword("2312321");
        user.setAge(22);
        userService.registerUser(user);
        return "good";
    }

}
